package cn.teaey.apns.network;
import java.io.Closeable;
import java.io.IOException;
/**
 * User: Teaey
 * Date: 13-9-1
 */
public interface Connection extends Closeable
{
    /**
     * Writes <code>data.length</code> bytes from the specified byte array
     * to this connection
     * @param data
     */
    void send(byte[] data) throws IOException;
    /**
     * Reads some number of bytes from the connection and stores them into
     * the buffer array <code>data</code>. The number of bytes actually read is
     * returned as an integer.
     * @param data
     */
    int recv(byte[] data) throws IOException;
}
